package cn.shawrainia.notedemo.service.impl;

import cn.shawrainia.notedemo.common.SendSms;
import cn.shawrainia.notedemo.common.SendStatusStatistics;
import cn.shawrainia.notedemo.domain.User;
import cn.shawrainia.notedemo.service.INoteService;
import com.tencentcloudapi.sms.v20210111.models.SendStatusStatisticsResponse;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

@Service
public class NoteServiceImpl implements INoteService {
    @Value("${notedemo.secretId}")
    private String secretId;
    @Value("${notedemo.secretKey}")
    private String secretKey;

    @Override
    public User send(Long userId, String phone) {
        return SendSms.send(userId, phone, secretId, secretKey);
    }
    @Override
    public SendStatusStatisticsResponse SendStatusStatistics(String beginTime, String endTime) {
        return SendStatusStatistics.StatisticalSms(beginTime,endTime,secretId,secretKey);
    }
}